<template>
    <div class="quarterly_report">
 
            <xlUntil text="服务经历" :queryParam="queryParam" :filtersVislble="true" :addBtn="formShow" :untilVisible="false"  v-bind="$attrs" @delBatch="delBatch" @addForm="addForm"  @searchKeyWord="searchKeyWord" :export-xls-data="columns" :export-xls-url="url.exportXlsUrl"></xlUntil>

        <div class="xl-table-content">
            <xlTable
                    :columns="columns"
                    :dataSource="data"
                    rowKey="id"
                    :pagination="false"
                    :loading="loading"
                    @change="handleTableChange"
                    bordered
                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
                >
                <template v-slot:action="scope">
                    <div v-if="formShow">
                    <a @click="editForm(scope.record)">编辑</a>
                        <a-divider type="vertical"/>
                        <a-dropdown>
                            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
                            <a-menu slot="overlay">
                                <a-menu-item @click="seeForm(scope.record)">
                                    <a>查看</a>
                                </a-menu-item>
                                <a-menu-item>
                                    <a-popconfirm title="确定删除吗?" @confirm="() => delForm(scope.record.id)">
                                        <a>删除</a>
                                    </a-popconfirm>
                                </a-menu-item>
                            </a-menu>
                        </a-dropdown>
                        </div>
                        <div v-else>
                            <a @click="seeForm(scope.record)" >查看</a>
                        </div>
                </template>
            </xlTable>
        </div>
        <xlForm ref="xlForm" @handleOk="handleOk"></xlForm>
        <seeForm ref="seeForm"></seeForm>
    </div>
</template>

<script>

    import xlMixin from '../../../mixin/index'
    // import seeForm from '../../../views/new/introduction_company/model/see'
    
    export default {
        name: "index",
        mixins:[xlMixin],
        data(){
            return{
                columns:[
                    {
                        title: '编号',
                        key: 'rowIndex',
                        align: "center",
                        fixed: 'left',
                        width:'80px',
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: '服务时间',
                        dataIndex: 'serviceDate',
                        fixed: 'left',
                        type:'date'
                    },
                    {
                        title: '服务机构名称',
                        dataIndex: 'serviceMechanismName',
                        // tableVisible:true, 列表不展示
                        type:'input'
                    },
                    {
                        title: '服务机构岗位',
                        dataIndex: 'serviceMechanismPosition',
                        type:'input'
                    },
                    {
                        title: '操作',
                        dataIndex: 'action',
                        align: "center",
                        fixed: 'right',
                        width:'150px',
                        scopedSlots: {customRender: 'action'},
                    }
                ],
                // 请求参数
                paramMore:{
                    adviserId:""
                },
                url: {
                    list: "/supermarket/api/advisory/body/service/pageList",
                    add: '/supermarket/api/advisory/body/service/add',
                    edit: '/supermarket/api/advisory/body/service/update',
                    delete: "/supermarket/api/advisory/body/service/remove",
                  
                }
            }
        },
        props:{
            formShow:Boolean,
            id:Number
        },
        created(){
            this.paramMore.adviserId = this.id
            this.formatMerge()
            this.pageOnload()
        },
        watch:{
        id(){
            this.paramMore.adviserId = this.id
            this.pageOnload()
        }
       },
       methods:{
       },
       components:{
        //    seeForm
       }
    }
</script>
<style scoped>

</style>
